package utils;

import java.util.Random;

public class SRandom {

	private static Random _r = null;
	
	private SRandom(){}
	
	private static Random getInstance() {
		if (_r == null)
			_r = new Random(System.currentTimeMillis());
		
		return _r;
	}
	
	public static boolean nextBoolean() {
		return getInstance().nextBoolean();
	}
	
	public static double nextDouble() {
		return getInstance().nextDouble();
	}
	
	public static double nextDouble(double max) {
		return getInstance().nextDouble() * max;
	}
	
	public static int nextInt(int n) {
		return getInstance().nextInt(n);
	}
}
